cmake_minimum_required(VERSION 3.8)
project(face_off)
set(CMAKE_CXX_STANDARD 11)


file(GLOB_RECURSE SOURCES src/*.cpp lib/*.cpp )
file(GLOB_RECURSE HEADERS include/*.h lib/*.h)

find_package(OpenCV 3.0)
if (NOT OpenCV_FOUND)
    message(FATAL_ERROR "OpenCV > 3.0 not found.")
endif ()


# ------------------ find dlib ------------------------
#find_package(dlib REQUIRED)
#include_directories(dlib::dlib)

find_package(dlib REQUIRED)
include_directories(${CMAKE_INCLUDE_PATH}/include/dlib)
if (dlib_FOUND)
    message(STATUS "we found dlib")
    message(STATUS ${CMAKE_INSTALL_PREFIX}/include/dlib)
endif ()


# ----------------- find cao library ------------------
find_package( PkgConfig )
pkg_check_modules( CAO REQUIRED cao )
if (CAO_FOUND)
    message(STATUS "[cao] we just found cao library")
endif ()


set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH  ${PROJECT_BINARY_DIR}/lib)

set(BUILD_SHARED_LIBS OFF)

set(SOURCE_FILES src/main.cpp src/face_detector.cpp src/face_detector.h)

add_executable(main ${SOURCE_FILES} ${SOURCES} ${HEADERS})
target_link_libraries(main ${OpenCV_LIBS} dlib::dlib ${CAO_LIBS})
#target_link_libraries(main ${OpenCV_LIBS} ${dlib_LIBRARIES})